﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using DTO;
using BUS;
using moved;

namespace WebChamCong
{
    public partial class jobsdtail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] == null || Request.QueryString["month"] == null)
            {
                Response.Redirect("index.aspx");
            }
            else 
            {
                Load_InfoJob();
            }
            
        }
        private void Load_InfoJob()
        {
            try {
                int id = int.Parse(Request.QueryString["id"].ToString());
                List<CheckDTO> listU = CheckBUS.GetJobByID(id);
                foreach (CheckDTO item in listU)
                {
                    if (item.FullName != null)
                    {
                        txttennv.Text = item.FullName.ToString();
                    }
                    BoPhanDTO BP = BoPhanBUS.GetBoPhanById(int.Parse(item.PartmentID.ToString()));
                    txtbophan.Text = BP.DepartmentName.ToString();
                    txtngaycong.Text = "01/" + Request.QueryString["month"].ToString() + "/" + DateTime.Now.Year.ToString();
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            
        }
        protected void Btxuatexel_Click(object sender, EventArgs e)
        {

        }

        protected void Btchamcon_Click(object sender, EventArgs e)
        {
            /*
            Response.Clear();
            Response.AddHeader("content-disposition", "attachment;filename=myexcel.xls");
            Response.ContentType = "application/ms-excel";
            System.IO.StringWriter sw = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(sw);
            mytable.RenderControl(hw);
            Response.Write(sw.ToString());
            Response.End();*/
        }
    }
  
}